Xbasic

Helper::HtmlProcessor.AddTagAttributeFilter Method

Syntax

v AddTagAttributeFilter(C attributeFilter, C valueExpression [, C options])

Arguments

attributeFilter

Which html attribute to call handler on.

valueExpression

Contains an expression that can contain placeholders for the tagname and current value of the attribute. Value of current attribute. Name lof current tag.

options

Character

Description

Adds a tag attribute filter.

Discussion

Add a tag attribute filter to an HTMLProcessor object. You can add as many tag attribute filters as you want. The value expression gets called everytime an attribute that matches the filter is found. The example script processes all the IMG tags 'src' attributes in processed HTML to point be prefixed with 'http://myimages.net/'. The result from running the script is this:

< html> 
  < body> 
  < img src="http://myimages.net/Logo.png" >
   < img src="http://myimages.net/Signature.png" >
    < /body>
     < /html>

Example

Example dim hh as helper::HtmlProcessor 
hh.AddTagAttributeFilter("src","changeSrc(,)") 
dim oldHtml as c = <